#ifndef _MUTEX_H
#define _MUTEX_H

#include <ds/semaphore.h>

typedef struct mutex {
    sem_t sem;
    struct process* owner;
} mutex_t;

void mutex_init(mutex_t* mutex);

void mutex_lock(mutex_t* mutex);

void mutex_unlock(mutex_t* mutex);

int mutex_locked(mutex_t* mutex);

#endif /* _MUTEX_H */